define(function(require, exports){
	exports.onMain = function(boot,data,app){
		// todo 校验router
		// if (!app.routerValid('')) {
		// 	return;
		// }
		var title = LANG('监控消息');
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title: title,
			type: 'sidebar'
		});
		con.createBusiness(data.name  + '_bar', 'layout/navbar.base', {
			'contentType': 'info',
			'autoBuild': true,
			'data': data,
			'addTitle': title,
			'type': 'admin'
		}, function(mod, created){
			if(mod){
				mod.setData(data, title);
			}
		});

		con.createBusiness(data.name, 'admin/messageMonitor/action/list.main',null, function(mod,notFirst){
			if(notFirst){
				mod.reload();
			}
		});
	}

	exports.onDetail = function(boot,data,app){
		// todo 校验router
		// if (!app.routerValid('')) {
		// 	return;
		// }
		var title = LANG('监控消息详情');
		var id = +data.param;
		var con = app.getContainer({
			scenes: 'main',
			full: false,
			sitelist: false,
			setup_btn: false,
			title: title,
			type: 'sidebar'
		});

		con.createBusiness(data.name  + '_bar', 'layout/navbar.base', {
			'contentType': 'info',
			'autoBuild': true,
			'data': data,
			'addTitle': title,
			'type': 'admin'
		}, function(mod, created){
			if(mod){
				mod.setData(data, title);
			}
		});
		con.createBusiness(data.name, 'admin/messageMonitor/action/detail.base',null, function(mod,created){
				if(created){
					mod.reset();
				}
				if(id){
					mod.load(id);
				}
			}
		);
	}
});